﻿@model SmartParking.Bussiness.PayPalModel

@{
    Layout = null;
}

<!DOCTYPE html>
<html>
<head>
    <title>SmartParking >> Redireccionando a PayPal</title>
    <script src="http://code.jquery.com/jquery-latest.min.js"></script>
    <style>
        .centered {
          position: fixed;
          top: 50%;
          left: 50%;
          margin-top: -50px;
          margin-left: -100px;
        }
    </style>
</head>
<body>
    <form id="frmPayPal" action='@Model.ActionUrl' method="post">
        @Html.Hidden("cmd", Model.Command)
        @if (Model.Command == "_cart")
        {
            @Html.Hidden("upload", "1")
        }
        @Html.Hidden("currency_code", Model.CurrencyCode)
        @Html.Hidden("business", Model.Business)
        @Html.Hidden("no_shipping", Model.NoShipping)
        @Html.Hidden("notify_url", Model.NotifyUrl)
        @Html.Hidden("return", Model.ReturnUrl)
        @Html.Hidden("rm", "2")
        @Html.Hidden("cbt", "Volver a SmartParking")
        @Html.Hidden("cancel_return", Model.CancelUrl)
        @Html.Hidden("invoice", Model.Invoice)
        @Html.Hidden("custom", Model.Custom)
        @Html.Hidden("lc", "ES")
        @Html.Hidden("no_note", "1")
        @foreach (var item in Model.PayPalItems)
        {
            @Html.Hidden("item_number_" + item.Number, item.Number)
            @Html.Hidden("item_name_" + item.Number, item.Name)
            @Html.Hidden("quantity_" + item.Number, item.Quantity)
            @Html.Hidden("amount_" + item.Number, item.Amount)
            @Html.Hidden("tax_" + item.Number, item.Tax)
        }
    </form>
    <div class="centered" style="text-align: center">
        <img src="~/Content/images/paypal-loading.gif"/>
        <p>
            <h4>Redireccionando a Paypal...</h4>
        </p>
    </div>
</body>
</html>

<script type="text/javascript">
    $(this.document).ready(function () {
        var frm = $("#frmPayPal");
        frm.submit();
    });
</script>
